package com.myfoon.model.comparator;

import java.util.Comparator;

public class LongComparator implements Comparator {
    private boolean asc = true;    
    
    public LongComparator(boolean asc) {
        this.asc = asc;
    }

    public int compare(Object o1, Object o2) {
        if (asc) {
            return ((Long)o1).compareTo((Long)o2);    
        }
        else {
            return -1*((Long)o1).compareTo((Long)o2);    
        }    
    }
}
